{% extends 'layout.html' %}
{% block content %}
{% for con in contents %}
<div class="listBox thumbnail">
    <h4 class="h4 text-center">{{con.title}}</h4>
    <p class="colDefault text-center">
        作者：<span class="colInfo text-primary">{{con.user.username}}</span>
        时间：<span class="colInfo text-primary">{{con.addTime | date('Y-m-d H:i:s', -8*60)}}</span>
        阅读：<span class="colInfo text-primary">{{con.views}}</span>
        评论：<span class="colInfo text-primary">{{con.comments.length}}</span>
    </p>
    <dfn>
        <p>{{con.description}}</p>
    </dfn>
    <div class="function"><a role="button" class="btn btn-warning btn-xs"
            href="/content?contentId={{con._id.toString()}}">阅读全文</a></div>
</div>
{% endfor %}
{% if pages > 0 %}
    <ul class="pager clear">
        <li class="previous">
            {% if page <= 1 %} <span>没有上一页了</span>
                {% else %}
                <a href="/?category={{category}}&page={{page-1}}">上一页</a>
                {% endif %}
        </li>
        <li><strong>{{page}}/{{pages}}</strong></li>
        <li class="next">
            {% if page < pages %} <a href="/?category={{category}}&page={{page+1}}">下一页</a>
                {% else %}
                <span>没有下一页了</span>
                {% endif %}
        </li>
    </ul>

{% endif %}
{% endblock %}